<?php
/**
 * Clears cache of content module
 * 
 * @author Konstantin Shamko <konstantin.shamko@gmail.com> 
 * @version 0.0.1
 * @copyright  Copyright (c) 2009 Konstantin Shamko
 * @category VaselinEngine
 * @package Content Module
 * @subpackage Helper
 * @license  New BSD License
 *
 */
class Helpers_Content_Cache{
	
	/**
	 * Clears menu cache
	 *
	 * @param string $menu_system_name
	 */
	public static function clearMenuCache($menu_system_name){
		$cache = Zend_Registry::get('cache');
		$cache->remove('menu_'.$menu_system_name);
	}

	/**
	 * Clears page cache
	 *
	 * @param string $page_system_name
	 */
	public static function cleanPageCache($page_system_name){
		$cache = Zend_Registry::get('cache');
		$cache->remove('page_'.$page_system_name);
		
		$oMenus = new Models_Content_Menus();
		foreach($oMenus->fetchAll() as $menu){
			$cache->remove('menu_'.$menu->menu_system_name);
		}
	}
	
}